package com.xixi.pojo.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {
    private Integer code;
    private String msg;
    private Object data;
    public static Result success(){
        Result result=new Result();
        result.setCode(200);
        result.setMsg("success");
        return result;
    }
    public static Result success(String message){
        Result result=new Result();
        result.setCode(200);
        result.setMsg(message);
        return result;
    }
    public static Result success(Object data){
        Result result=new Result();
        result.setCode(200);
        result.setMsg("success");
        result.setData(data);
        return result;
    }
    public static Result success(String message,Object data){
        Result result=new Result();
        result.setCode(200);
        result.setMsg(message);
        result.setData(data);
        return result;
    }
    public static Result error(String message){
        Result result=new Result();
        result.setCode(500);
        result.setMsg(message);
        return result;
    }

}
